package top.purity.server.tenant.service.convert;

import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import top.purity.server.tenant.controller.vo.AddTenantUserReqVO;
import top.purity.server.tenant.controller.vo.TenantInfoVO;
import top.purity.server.tenant.controller.vo.UpdateTenantUserReqVO;
import top.purity.server.tenant.domain.TenantMenu;
import top.purity.server.tenant.domain.TenantUser;
import top.purity.server.tenant.feign.output.dto.PermissionDTO;
import top.purity.server.tenant.feign.output.dto.TenantInfoDTO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.Collection;
import java.util.List;

/**
 * @version 1.0
 * @Author Lmh
 * @Description
 * @CreateTime 2023-09-24 20:32
 */
@Mapper
public interface TenantUserConvert {

    TenantUserConvert INSTANCE = Mappers.getMapper(TenantUserConvert.class);

    TenantInfoDTO convertToTenantInfoDto(TenantUser tenantUser);

    TenantInfoVO convertToTenantInfoVo(TenantUser tenantUser);

    TenantUser convertToDo(AddTenantUserReqVO vo);
    TenantUser convertToDo(UpdateTenantUserReqVO vo);

    List<TenantInfoVO> convertToTenantInfoVoList(Collection<TenantUser> tenantUsers);

    @Mappings({
            @Mapping(source = "tenantName", target = "name"),
            @Mapping(source = "tenantCode", target = "code")
    })
    TenantInfoVO.BaseInfo convertToTenantInfoBaseInfoVo(TenantUser tenantUsers);

    TenantInfoVO.AddrInfo convertToTenantInfoAddrInfoVo(TenantUser tenantUsers);

}
